package com.jlnk.dagger.application;

import android.app.Application;
import com.jlnk.dagger.component.AllComponent;
import com.jlnk.dagger.component.DaggerAllComponent;
import com.jlnk.dagger.module.DBModule;
import com.jlnk.dagger.module.SpUtilsModule;
import com.jlnk.dagger.module.StudentModule;
import com.jlnk.dagger.utils.SpUtils;

public class MyApplication extends Application {
    private AllComponent allComponent;

    @Override
    public void onCreate() {
        super.onCreate();
        allComponent = DaggerAllComponent.builder()
                .dBModule(new DBModule(this))
                .studentModule(new StudentModule())
                .spUtilsModule(new SpUtilsModule())
                .build();
    }

    public AllComponent getAllComponent() {
        return allComponent;
    }
    public SpUtils getSpUtils() {
        return allComponent.getSpUtils();
    }
}